tests: Always cleanup gpg-agent when exiting
authorDan Nicholson <nicholson@endlessm.com>
Thu, 13 Jun 2019 21:26:47 +0000 (16:26 -0500)
committerAtomic Bot <atomic-devel@projectatomic.io>
Wed, 19 Jun 2019 17:30:24 +0000 (17:30 +0000)
commitabb173352da5fa6017746c27fab1eff220c4cfbd
tree0b972ea0b3c8fd655191cf88d5ad1950199ec8d8
parent0dd27bbf4b5a3f132a9b2418b391dacbcd64a003
tests: Always cleanup gpg-agent when exiting

Add `libtest_cleanup_gpg()` to the array of commands to run when
exiting. This provides 2 improvements:

1. You don't need to worry about whether the test will spawn a gpg-agent
   and therefore require adding a call to `libtest_cleanup_gpg()`.

2. All the existing users were calling `libtest_cleanup_gpg()` at the
   end of the script. If there was a failure and the script exited
   early, then it wouldn't cleanup and there may be a stray gpg-agent
   hanging around.

Closes: #1799
Approved by: cgwalters
tests/libtest.sh
tests/test-commit-sign.sh
tests/test-gpg-signed-commit.sh
tests/test-pull-mirror-summary.sh
tests/test-pull-summary-sigs.sh
tests/test-remote-gpg-import.sh
tests/test-summary-view.sh